<?php
session_start();
require '../nette/Nette/loader.php';
require '../db.php';
require '../localization/lang.php';
require '../core/core.sanitizer.php';
require '../core/core.security.php';
require '../core/core.dfs.php';
require '../visual/visual.dfs.php';

$login=new core_security;
if ($login->checklogin()=="OK" AND $_SESSION['role']<=1) {



if (isset($_POST['id'])) {
$query="select * from users where id=".mysql_real_escape_string($_POST['id'])."";
$result=mysql_query($query);
$row=mysql_fetch_array($result);

if ($row['statistics'] == 1) {
	$query="update users set statistics=0 where id=".mysql_real_escape_string($_POST['id'])."";
	mysql_query($query);
	}
if ($row['statistics'] == 0) {
	$query="update users set statistics=1 where id=".mysql_real_escape_string($_POST['id'])."";
	mysql_query($query);
	}
}
}
